package com.jike.noobmoney.adapter;


import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.jike.noobmoney.R;
import com.jike.noobmoney.entity.MessageEntity;


/**
 * Created by kekex on 2018/9/8.
 * message
 */

public class MessageListAdapter extends BaseRecyclerAdapter<MessageEntity.MessageBean> {


    private Context context;

    public MessageListAdapter(Context context) {
        super(R.layout.item_message_list);
        this.context = context;
    }

    @Override
    protected void onBindViewHolder(SmartViewHolder holder, MessageEntity.MessageBean item, int position) {
        holder.text(R.id.tv_time, item.getCreatetime());
        holder.text(R.id.tv_title, item.getTitle());
        holder.text(R.id.tv_content, item.getText());

        TextView tv_title = (TextView)holder.findViewById(R.id.tv_title);
        TextView viewById = (TextView)holder.findViewById(R.id.tv_content);
        int see = item.getSee();
        if (see == 0){
            //未读
            tv_title.setTextColor(context.getResources().getColor(R.color.c_4a4a4a));
            viewById.setTextColor(context.getResources().getColor(R.color.c_666666));
        }else{
            //已读
            viewById.setTextColor(context.getResources().getColor(R.color.c_9a9a9a));
            tv_title.setTextColor(context.getResources().getColor(R.color.c_9a9a9a));
        }

    }
}
